package a.f.g.a;

import a.c.e;
import a.c.w;
import a.f.o;
import a.i.y;

import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;

public class h
  implements bc
{
  private Rectangle2D.Double a;
  public static boolean b;
  
  public h(Rectangle2D.Double paramDouble)
  {
    this.a = paramDouble;
  }
  
  public void a(bb parambb, xb paramxb)
  {
    boolean bool = xb.r;
    int i = xb.q;
    o localo = paramxb.m();
    y localy = new y(localo);
    a.c.bb localbb = new a.c.bb();
    w localw = localo.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      if ((!bool) && (i != 0)) {
        return;
      }
      if (!bool)
      {
        if (paramxb.d(locale).j() == 1.0D) {
          localbb.add(locale);
        }
        localw.f();
      }
    } while (i == 0);
    localy.a(localbb);
    b(parambb, paramxb);
    if (!bool) {
      localy.g();
    }
  }
  
  void b(bb parambb, xb paramxb)
  {
    boolean bool = xb.r;
    int i = xb.q;
    o localo = paramxb.m();
    if (!bool) {
      if (localo.j() == 0) {
        return;
      }
    }
    Object localObject = localo.v();
    do
    {
      if (!((w)localObject).e()) {
        break;
      }
      xb.a_ locala_1 = paramxb.d(((w)localObject).d());
      if ((bool) || (locala_1.f() <= this.a.getWidth()))
      {
        if (bool) {
          continue;
        }
        if (locala_1.e() <= this.a.getHeight()) {}
      }
      else
      {
        return;
      }
      ((w)localObject).f();
    } while (i == 0);
    localObject = c(parambb, paramxb);
    double d1 = this.a.getWidth() / 2.0D;
    double d2 = this.a.getHeight() / 2.0D;
    double d3 = 1.0D;
    double d4 = 1.0D;
    w localw1 = localo.v();
    do
    {
      do
      {
        if (!localw1.e()) {
          break;
        }
        xb.a_ locala_2 = paramxb.d(localw1.d());
        double d5 = Math.abs(((Rectangle2D)localObject).getCenterX() - locala_2.b());
        double d6 = Math.abs(((Rectangle2D)localObject).getCenterY() - locala_2.c());
        double d7 = d1 - locala_2.f() / 2.0D;
        double d8 = d2 - locala_2.e() / 2.0D;
        d3 = Math.min(d3, d7 / d5);
        d4 = Math.min(d4, d8 / d6);
        localw1.f();
        if ((!bool) && (i != 0)) {
          break label316;
        }
      } while (i == 0);
    } while (bool);
    if (!bool)
    {
      if (d3 >= 1.0D) {
        if (bool) {
          break label356;
        }
      }
    }
    else {
      if (d4 >= 1.0D) {
        break label336;
      }
    }
    label316:
    a(parambb, paramxb, ((Rectangle2D)localObject).getCenterX(), ((Rectangle2D)localObject).getCenterY(), d3, d4);
    label336:
    localObject = c(parambb, paramxb);
    label356:
    double d9 = this.a.getCenterX() - ((Rectangle2D)localObject).getCenterX();
    double d10 = this.a.getCenterY() - ((Rectangle2D)localObject).getCenterY();
    if (!this.a.contains((Rectangle2D)localObject))
    {
      w localw2 = localo.v();
      do
      {
        if (!localw2.e()) {
          break;
        }
        xb.a_ locala_3 = paramxb.d(localw2.d());
        locala_3.a(locala_3.b() + d9);
        locala_3.c(locala_3.c() + d10);
        localw2.f();
      } while (i == 0);
    }
  }
  
  Rectangle2D c(bb parambb, xb paramxb)
  {
    int i = xb.q;
    double d1 = 1.7976931348623157E+308D;
    double d2 = 1.7976931348623157E+308D;
    double d3 = -1.797693134862316E+308D;
    double d4 = -1.797693134862316E+308D;
    w localw = paramxb.m().v();
    do
    {
      if (!localw.e()) {
        break;
      }
      xb.a_ locala_ = paramxb.d(localw.d());
      d1 = Math.min(d1, locala_.b());
      d2 = Math.min(d2, locala_.c());
      d3 = Math.max(d3, locala_.b());
      d4 = Math.max(d4, locala_.c());
      localw.f();
    } while (i == 0);
    return new Rectangle2D.Double(d1, d2, d3 - d1, d4 - d2);
  }
  
  void a(bb parambb, xb paramxb, double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    int i = xb.q;
    o localo = paramxb.m();
    AffineTransform localAffineTransform = new AffineTransform();
    Point2D.Double localDouble = new Point2D.Double();
    localAffineTransform.translate(paramDouble1, paramDouble2);
    localAffineTransform.scale(paramDouble3, paramDouble4);
    localAffineTransform.translate(-paramDouble1, -paramDouble2);
    w localw = localo.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      xb.a_ locala_ = paramxb.d(locale);
      localDouble.setLocation(locala_.b(), locala_.c());
      localAffineTransform.transform(localDouble, localDouble);
      locala_.a(localDouble.getX());
      locala_.c(localDouble.getY());
      localw.f();
    } while (i == 0);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.g.a.h

 * JD-Core Version:    0.7.0.1

 */